// @APIVersion 1.0.0
// @Title 姜玉印
// @Description 220320204005
// @Contact 2410669370@qq.com

package routers

import (
	"chuanyou1/controllers"
	"chuanyou1/models"

	beego "github.com/beego/beego/v2/server/web"
)

func init() {
	ns := beego.NewNamespace("/v1",

		beego.NSNamespace("/classmates",
			beego.NSInclude(
				&controllers.ClassmatesController{},
			),
		),

		beego.NSNamespace("/logs",
			beego.NSInclude(
				&controllers.LogsController{},
			),
		),

		beego.NSNamespace("/records",
			beego.NSInclude(
				&controllers.RecordsController{},
			),
		),
		beego.NSNamespace("/teacher",
			beego.NSInclude(
				&controllers.TeacherController{},
			),
		),
	)
	beego.AddNamespace(ns)

	beego.InsertFilter("/v1/*", beego.BeforeRouter, models.FilterUser)

}
